#include<bits/stdc++.h>
using namespace std;
int main(){
	int money,n;
	cin >> money >> n;
	int n1,n2,bet,t;
	for(int i = 0;i < n;i++){
		cin >> n1 >> bet >> t >> n2;
		if(money<t) cout << "Not enough tokens.  Total = " << money << "." << endl;
		else if((n2>n1 && bet)||(n1>n2 && bet==0)){
			money += t;
			cout << "Win " << t << "!  Total = " << money << "." << endl;
		}
		else if((n2>n1 && bet==0)||(n1>n2 && bet)){
			money -= t;
			cout << "Lose " << t << ".  Total = " << money << "." << endl;
		}
		if(!money){
			cout << "Game Over." << endl;
			break;
		}
	}
	return 0;
}

